package com.jeesite.modules.exam.socreResult.service;

import com.jeesite.common.entity.Page;
import com.jeesite.modules.exam.quota.dao.DcSupExamOrgScoreDao;
import com.jeesite.modules.exam.quota.entity.DcSupExamSumQuotaInfo;
import com.jeesite.modules.exam.score.entity.*;
import com.jeesite.modules.exam.score.service.DcSupExamOrgScoreService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

@Service
@RequiredArgsConstructor
public class DcSupExamRankingService {

    private final DcSupExamOrgScoreService dcSupExamOrgScoreService;

    private final DcSupExamOrgScoreDao dcSupExamOrgScoreDao;

    public List<DcSupExamOrgScore> unitListData(DcSupExamOrgScore dcSupExamOrgScore){
        return dcSupExamOrgScoreService.findUnitListData(dcSupExamOrgScore);
    }

    public Page<DcSupExamSumQuotaInfo> indexListData(DcSupExamSumQuotaInfo dcSupExamSumQuotaInfo) {
        return dcSupExamOrgScoreService.indexListData(dcSupExamSumQuotaInfo);
    }

    public List<DcSupExamDxSortExport> exportDxSort(DcSupExamDxSort  dcSupExamDxSort) {
        return dcSupExamOrgScoreDao.exportDxSortData(dcSupExamDxSort);
    }

    public List<DcSupExamSortExport> exprotSort(String examId) {
        return dcSupExamOrgScoreDao.exportSort(examId);
    }

    public Page<DcSupExamSumQuotaInfo> findDXRanKingListPage(DcSupExamSumQuotaInfo dcSupExamSumQuotaInfo) {
        return dcSupExamOrgScoreService.findDXRanKingListPage(dcSupExamSumQuotaInfo);
    }

    public List<DcSupExamSumQuotaInfo> findUnitRankingScoreData(DcSupExamSumQuotaInfo dcSupExamSumQuotaInfo) {
        return dcSupExamOrgScoreService.findUnitRankingScoreData(dcSupExamSumQuotaInfo);
    }

    public Page<DcSupExamDxSort> danUnitListDataPage(DcSupExamDxSort dcSupExamDxSort) {
        return dcSupExamDxSort.getPage().setList(dcSupExamOrgScoreDao.findDanListData(dcSupExamDxSort));
    }
}
